package com.baiyue.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

/**
 *
 * @author 伍波
 * @date 2024-06-20
 */
@Data
@TableName("commodity_consumption")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class CommodityConsumption implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 商品ID
     */
    @TableField("commodity_id")
    private Integer commodityId;
    /**
     * 商品名称
     */
    @TableField("commodity_name")
    private String commodityName;
    /**
     * 商品单价
     */
    @TableField("unit_price")
    private BigDecimal unitPrice;
    /**
     * 商品数量
     */
    private Integer quantity;
    /**
     * 商品合计金额
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;
    /**
     * 状态：0-正常，1-取消
     */
    private Integer status;
    /**
     * 包间唯一标识
     */
    private String uuid;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 创建人
     */
    private String creator;
    /**
     * 更新人
     */
    private String updater;

    /**
     * 开始时间
     */
    @TableField(exist = false)
    private String start;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private String end;

    /**
     * 排序字段
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortField;

    /**
     * 排序顺序
     * desc  asc
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortValue;

    public CommodityConsumption(Integer commodityId, String commodityName, BigDecimal unitPrice, Integer quantity,
                                BigDecimal totalAmount, Integer status, String uuid, Date createTime, Date updateTime,
                                String creator, String updater, String start, String end, String sortField,
                                String sortValue) {
        this.commodityId = commodityId;
        this.commodityName = commodityName;
        this.unitPrice = unitPrice;
        this.quantity = quantity;
        this.totalAmount = totalAmount;
        this.status = status;
        this.uuid = uuid;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.creator = creator;
        this.updater = updater;
        this.start = start;
        this.end = end;
        this.sortField = sortField;
        this.sortValue = sortValue;
    }
}
